.class Lcom/opongo/blogapp/activities/AppPreferenceActivity$6;
.super Ljava/lang/Object;
.source "AppPreferenceActivity.java"

# interfaces
.implements Landroid/preference/Preference$OnPreferenceClickListener;


# annotations
.annotation system Ldalvik/annotation/EnclosingMethod;
    value = Lcom/opongo/blogapp/activities/AppPreferenceActivity;->onCreate(Landroid/os/Bundle;)V
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0x0
    name = null
.end annotation


# instance fields
.field final synthetic this$0:Lcom/opongo/blogapp/activities/AppPreferenceActivity;


# direct methods
.method constructor <init>(Lcom/opongo/blogapp/activities/AppPreferenceActivity;)V
    .locals 0
    .parameter

    .prologue
    .line 1
    iput-object p1, p0, Lcom/opongo/blogapp/activities/AppPreferenceActivity$6;->this$0:Lcom/opongo/blogapp/activities/AppPreferenceActivity;

    .line 193
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    return-void
.end method


# virtual methods
.method public onPreferenceClick(Landroid/preference/Preference;)Z
    .locals 12
    .parameter "preference"

    .prologue
    .line 196
    iget-object v9, p0, Lcom/opongo/blogapp/activities/AppPreferenceActivity$6;->this$0:Lcom/opongo/blogapp/activities/AppPreferenceActivity;

    invoke-virtual {v9}, Lcom/opongo/blogapp/activities/AppPreferenceActivity;->getApplicationContext()Landroid/content/Context;

    move-result-object v0

    .line 197
    .local v0, context:Landroid/content/Context;
    iget-object v9, p0, Lcom/opongo/blogapp/activities/AppPreferenceActivity$6;->this$0:Lcom/opongo/blogapp/activities/AppPreferenceActivity;

    const-string v10, "BlogApp"

    const/4 v11, 0x0

    invoke-virtual {v0, v10, v11}, Landroid/content/Context;->getSharedPreferences(Ljava/lang/String;I)Landroid/content/SharedPreferences;

    move-result-object v10

    #setter for: Lcom/opongo/blogapp/activities/AppPreferenceActivity;->settings:Landroid/content/SharedPreferences;
    invoke-static {v9, v10}, Lcom/opongo/blogapp/activities/AppPreferenceActivity;->access$7(Lcom/opongo/blogapp/activities/AppPreferenceActivity;Landroid/content/SharedPreferences;)V

    .line 199
    iget-object v9, p0, Lcom/opongo/blogapp/activities/AppPreferenceActivity$6;->this$0:Lcom/opongo/blogapp/activities/AppPreferenceActivity;

    #getter for: Lcom/opongo/blogapp/activities/AppPreferenceActivity;->settings:Landroid/content/SharedPreferences;
    invoke-static {v9}, Lcom/opongo/blogapp/activities/AppPreferenceActivity;->access$8(Lcom/opongo/blogapp/activities/AppPreferenceActivity;)Landroid/content/SharedPreferences;

    move-result-object v9

    const-string v10, "blog_details"

    const-string v11, "Error"

    invoke-interface {v9, v10, v11}, Landroid/content/SharedPreferences;->getString(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;

    move-result-object v1

    .line 202
    .local v1, detailString:Ljava/lang/String;
    const-string v5, "Error"

    .line 203
    .local v5, text:Ljava/lang/String;
    const-string v7, "Error"

    .line 206
    .local v7, text2:Ljava/lang/String;
    :try_start_0
    new-instance v4, Lorg/json/JSONObject;

    invoke-direct {v4, v1}, Lorg/json/JSONObject;-><init>(Ljava/lang/String;)V

    .line 208
    .local v4, json:Lorg/json/JSONObject;
    new-instance v6, Ljava/lang/String;

    const-string v9, "recommendation_subject"

    invoke-virtual {v4, v9}, Lorg/json/JSONObject;->getString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v9

    invoke-direct {v6, v9}, Ljava/lang/String;-><init>(Ljava/lang/String;)V
    :try_end_0
    .catch Lorg/json/JSONException; {:try_start_0 .. :try_end_0} :catch_0

    .line 209
    .end local v5           #text:Ljava/lang/String;
    .local v6, text:Ljava/lang/String;
    :try_start_1
    new-instance v8, Ljava/lang/String;

    const-string v9, "recommendation_text"

    invoke-virtual {v4, v9}, Lorg/json/JSONObject;->getString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v9

    invoke-direct {v8, v9}, Ljava/lang/String;-><init>(Ljava/lang/String;)V
    :try_end_1
    .catch Lorg/json/JSONException; {:try_start_1 .. :try_end_1} :catch_1

    .end local v7           #text2:Ljava/lang/String;
    .local v8, text2:Ljava/lang/String;
    move-object v7, v8

    .end local v8           #text2:Ljava/lang/String;
    .restart local v7       #text2:Ljava/lang/String;
    move-object v5, v6

    .line 216
    .end local v4           #json:Lorg/json/JSONObject;
    .end local v6           #text:Ljava/lang/String;
    .restart local v5       #text:Ljava/lang/String;
    :goto_0
    new-instance v3, Landroid/content/Intent;

    const-string v9, "android.intent.action.SEND"

    invoke-direct {v3, v9}, Landroid/content/Intent;-><init>(Ljava/lang/String;)V

    .line 217
    .local v3, intent:Landroid/content/Intent;
    const-string v9, "text/plain"

    invoke-virtual {v3, v9}, Landroid/content/Intent;->setType(Ljava/lang/String;)Landroid/content/Intent;

    .line 219
    const-string v9, "android.intent.extra.SUBJECT"

    invoke-virtual {v3, v9, v5}, Landroid/content/Intent;->putExtra(Ljava/lang/String;Ljava/lang/String;)Landroid/content/Intent;

    .line 220
    const-string v9, "android.intent.extra.TEXT"

    invoke-virtual {v3, v9, v7}, Landroid/content/Intent;->putExtra(Ljava/lang/String;Ljava/lang/String;)Landroid/content/Intent;

    .line 222
    iget-object v9, p0, Lcom/opongo/blogapp/activities/AppPreferenceActivity$6;->this$0:Lcom/opongo/blogapp/activities/AppPreferenceActivity;

    iget-object v10, p0, Lcom/opongo/blogapp/activities/AppPreferenceActivity$6;->this$0:Lcom/opongo/blogapp/activities/AppPreferenceActivity;

    const v11, 0x7f070038

    invoke-virtual {v10, v11}, Lcom/opongo/blogapp/activities/AppPreferenceActivity;->getString(I)Ljava/lang/String;

    move-result-object v10

    invoke-static {v3, v10}, Landroid/content/Intent;->createChooser(Landroid/content/Intent;Ljava/lang/CharSequence;)Landroid/content/Intent;

    move-result-object v10

    invoke-virtual {v9, v10}, Lcom/opongo/blogapp/activities/AppPreferenceActivity;->startActivity(Landroid/content/Intent;)V

    .line 224
    const/4 v9, 0x1

    return v9

    .line 211
    .end local v3           #intent:Landroid/content/Intent;
    :catch_0
    move-exception v2

    .line 213
    .local v2, e:Lorg/json/JSONException;
    :goto_1
    invoke-virtual {v2}, Lorg/json/JSONException;->printStackTrace()V

    goto :goto_0

    .line 211
    .end local v2           #e:Lorg/json/JSONException;
    .end local v5           #text:Ljava/lang/String;
    .restart local v4       #json:Lorg/json/JSONObject;
    .restart local v6       #text:Ljava/lang/String;
    :catch_1
    move-exception v2

    move-object v5, v6

    .end local v6           #text:Ljava/lang/String;
    .restart local v5       #text:Ljava/lang/String;
    goto :goto_1
.end method
